import { requestApi } from "@/utils/request";
import type { DailyRecomTypeResponse, FourTravelTypeResponse, HomeTravelsTypeResponse, RecommTravelTabTypeResponse, RecommTravelTypeResponse } from "@/types/home";

// 获取每日推荐
export const getDailyRecomAPI = async (page: number) => {
    return requestApi<DailyRecomTypeResponse>({
        url: '/wxGainDailyRecom',
        method: 'GET',
        data: {
            page: page
        }
    })
}

// 获取首页瀑布流游记
export const getHomeTravelsAPI = async (keywords: string, page: number) => {
    return requestApi<HomeTravelsTypeResponse>({
        url: '/user-travels',
        method: 'GET',
        data: {
            keywords: keywords,
            page: page
        }
    })
}

// 获取四个游记推荐
export const getFourTravelAPI = async () => {
    return requestApi<FourTravelTypeResponse>({
        url: '/wxGainRecomTravel',
        method: 'GET',
    })
}
// 获取10个游记分类
export const getRecommTravelAPI = async () => {
    return requestApi<RecommTravelTypeResponse>({
        url: '/recomm-travel',
        method: 'GET',
    })
}

// 获取游记分类切换tab
export const getRecommTravelTabAPI = async () => {
    return requestApi<RecommTravelTabTypeResponse>({
        url: '/travelogue-class',
        method: 'GET',
    })
}
